<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- 页面加载事件 -->
<body onload="init()">
    <p>
        选择你喜欢的书：
        <input type="radio" name="ts" onclick="fun()" />图书一 &nbsp;<!-- onclick="fn('tp1')" -->
        <input type="radio" name="ts" onclick="fun()" />图书二 <!-- onclick="fn('tp2')" -->
    </p>
    <div id="tp1">
        <img src="images/dog.jpg" />
    </div>
    <div id="tp2">
        <img src="images/mai.jpg" />
    </div>
    <script type="text/javascript" src="js/1.js"></script>
</body>
</html>